翻訳と辞書
Words near each other
・ Return to Waterloo (film)
・ Return to White Plume Mountain
・ Return to Witchwood
・ Return to Yesterday
・ Return to Yggdrasill
・ Return to You
・ Return to Yugoslavia
・ Return to Zero
・ Return to Zero (film)
・ Return to Zero (RTZ album)
・ Return to Zero (Spiritual Beggars album)
・ Return to Zion
・ Return to Zork
・ Return Torrey
・ Return type
Return value optimization
・ Return with Honor
・ Return yards
・ Return-oriented programming
・ Return-to-libc attack
・ Return-to-zero
・ Returnal
・ Returned and Services League of Australia
・ Returned to unit
・ Returned to Your Mind
・ Returned Treasures Program
・ Returnees from Albania
・ Returner
・ Returner (disambiguation)
・ Returner (liqueur)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Return value optimization : ウィキペディア英語版
Return value optimization

Return value optimization, or simply RVO, is a compiler optimization technique that involves eliminating the temporary object created to hold a function's return value. In C++, it is particularly notable for being allowed to change the observable behaviour of the resulting program.
== Summary ==
In general, the C++ standard allows a compiler to perform any optimization, provided the resulting executable exhibits the same observable behaviour ''as if'' (i.e. pretending) all the requirements of the standard have been fulfilled. This is commonly referred to as the "as-if rule".〔ISO/IEC (2003). ''ISO/IEC 14882:2003(E): Programming Languages - C++ §1.9 Program execution ()'' para. 1〕 The term ''return value optimization'' refers to a special clause in the C++ standard that goes even further than the "as-if" rule: an implementation may omit a copy operation resulting from a return statement, even if the copy constructor has side effects.〔ISO/IEC (2003). ''ISO/IEC 14882:2003(E): Programming Languages - C++ §12.8 Copying class objects ()'' para. 15〕
The following example demonstrates a scenario where the implementation may eliminate one or both of the copies being made, even if the copy constructor has a visible side effect (printing text).〔 The first copy that may be eliminated is the one where C() is copied into the function f's return value. The second copy that may be eliminated is the copy of the temporary object returned by f to obj.

#include
struct C
};
C f()
int main()

Depending upon the compiler, and that compiler's settings, the resulting program may display any of the following outputs:
Hello World!
A copy was made.
A copy was made.

Hello World!
A copy was made.

Hello World!


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Return value optimization」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.